<!--
用户工具条
@author pan
@createDate 2022/02 2022/2/27 12:02
-->
<script setup lang="ts" name="UserToolbar">
import { Search, Help, Setting, Bell } from '@element-plus/icons-vue'
</script>

<template>
  <div class="cUserToolbar">
    <a>
      <el-dropdown>
        <div class="userInfo">
          <el-avatar
            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
            :size="28"
            class="userAvatar"
          ></el-avatar>
          <span class="userName">王图思睿65</span>
        </div>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>用户详情</el-dropdown-item>
            <el-dropdown-item>修改密码</el-dropdown-item>
            <el-dropdown-item>退出</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </a>
    <a>
      <el-tooltip
        class="box-item"
        effect="dark"
        content="提醒"
        placement="bottom"
      >
        <el-badge is-dot class="bellItem">
          <el-icon :size="20" class="sysIcon">
            <bell></bell>
          </el-icon>
        </el-badge>
      </el-tooltip>
    </a>
    <a>
      <el-tooltip
        class="box-item"
        effect="dark"
        content="设置"
        placement="bottom"
      >
        <el-icon :size="20" class="sysIcon">
          <setting></setting>
        </el-icon>
      </el-tooltip>
    </a>
    <a>
      <el-tooltip
        class="box-item"
        effect="dark"
        content="帮助"
        placement="bottom"
      >
        <el-icon :size="20" class="sysIcon">
          <help></help>
        </el-icon>
      </el-tooltip>
    </a>
  </div>
</template>

<style lang="scss" scoped>
.cUserToolbar {
  height: 100%;

  a {
    color: $white;
    display: block;
    height: $topNavHeight;
    line-height: $topNavHeight;
    float: right;
    padding-left: 8px;
    padding-right: 8px;
    cursor: pointer;
  }

  .sysIcon {
    position: relative;
    height: $topNavHeight;
  }

  .bellItem {
    margin: 0;
    padding: 0;
    position: relative;
    top: -2px;
    ::v-deep(.el-badge__content) {
      top: 13px;
    }
  }
  .userInfo {
    height: $topNavHeight;
  }
  .userAvatar {
    position: relative;
    top: 10px;
  }
  .userName {
    position: relative;
    top: 2px;
    margin-left: 8px;
    @include textOverflow(92px, inline-block);
    color: $white;
  }
}
</style>
